package com.demo.burt.mysql.tech.read.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.demo.burt.dataobject.TestOrder;
import com.demo.burt.dataobject.dto.UserOrderDto;

/**
 * <p>
 * 订单读Mapper 接口
 * </p>
 *
 * @author luowei1
 * @since 2018-12-12
 */
public interface TestOrderReadMapper extends BaseMapper<TestOrder> {

    /**
     * 通过userId获取该用户的订单
     * 
     * @param userId 用户id
     * @return
     */
    //请注意，这里用的是ibatis包下的Param
    List<Map<String, Object>> queryOrderMapByUserId(@Param("userId") Long userId);

    /**
     * 通过userId获取该用户的订单
     * 
     * @param userId 用户id
     * @return {@link UserOrderDto}
     */
    UserOrderDto queryOrderByUserId(@Param("userId") Long userId);

    List<UserOrderDto> queryUserOrder();
}
